<?php
require_once dirname(dirname(dirname(__FILE__))) . '/my/conf/config.php';

$m = isset($_REQUEST['m']) ? $_REQUEST['m'] : 'index';
$a = isset($_REQUEST['a']) ? $_REQUEST['a'] : 'index';
session_commit();
user::needLogin();

$file		= ROOT . "app/$m.class.php";
$class		= $m . 'App';
$method		= $a . 'Action';

file_exists($file) ? require_once $file	: errorHandle::fileNotFound($file);
class_exists($class)			|| errorHandle::classNotFound($class);
method_exists($class,$method)   || errorHandle::methodNotFound($method);

try
{
    $app = new $class;
    $app->$method($request);
}
catch (Exception $e)
{
    errorHandle::error($e);
}